blob: 837fb08b7971a8b948dd7d039bab4a3c2e54cac7 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-cherry-pick(1)
2==================
3
4NAME
5----
Junio C Hamano01078922006-03-10 00:31:476git-cherry-pick - Apply the change introduced by an existing commit
Junio C Hamano1a4e8412005-12-27 08:17:237
8SYNOPSIS
9--------
Junio C Hamanofce7c7e2008-07-02 03:06:3810'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] <commit>
Junio C Hamano1a4e8412005-12-27 08:17:2311
12DESCRIPTION
13-----------
14Given one existing commit, apply the change the patch introduces, and record a
15new commit that records it. This requires your working tree to be clean (no
16modifications from the HEAD commit).
17
18OPTIONS
19-------
20<commit>::
21Commit to cherry-pick.
Junio C Hamanofce7c7e2008-07-02 03:06:3822For a more complete list of ways to spell commits, see the
Junio C Hamano35738e82008-01-07 07:55:4623"SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
Junio C Hamano1a4e8412005-12-27 08:17:2324
Junio C Hamanoeb415992008-06-08 22:49:4725-e::
26--edit::
Junio C Hamanoba4b9282008-07-06 05:20:3127With this option, 'git-cherry-pick' will let you edit the commit
Junio C Hamano0e661132008-01-21 02:37:4428message prior to committing.
Junio C Hamano1a4e8412005-12-27 08:17:2329
Junio C Hamanoaf2b8c52006-10-06 01:00:4030-x::
Junio C Hamano764a6672007-10-23 01:23:3131When recording the commit, append to the original commit
32message a note that indicates which commit this change
33was cherry-picked from. Append the note only for cherry
34picks without conflicts. Do not use this option if
35you are cherry-picking from your private branch because
36the information is useless to the recipient. If on the
Junio C Hamanoaf2b8c52006-10-06 01:00:4037other hand you are cherry-picking between two publicly
38visible branches (e.g. backporting a fix to a
39maintenance branch for an older release from a
40development branch), adding this information can be
41useful.
42
Junio C Hamano81c711d2007-04-20 07:20:1443-r::
Junio C Hamanoaf2b8c52006-10-06 01:00:4044It used to be that the command defaulted to do `-x`
45described above, and `-r` was to disable it. Now the
46default is not to do `-x` so this option is a no-op.
Junio C Hamano1a4e8412005-12-27 08:17:2347
Junio C Hamanoeb415992008-06-08 22:49:4748-m parent-number::
49--mainline parent-number::
Junio C Hamano69a98582008-03-01 18:42:1850Usually you cannot cherry-pick a merge because you do not know which
Junio C Hamanod814b6d2007-11-04 11:13:4951side of the merge should be considered the mainline. This
52option specifies the parent number (starting from 1) of
53the mainline and allows cherry-pick to replay the change
54relative to the specified parent.
55
Junio C Hamanoeb415992008-06-08 22:49:4756-n::
57--no-commit::
Junio C Hamano1a4e8412005-12-27 08:17:2358Usually the command automatically creates a commit with
59a commit log message stating which commit was
60cherry-picked. This flag applies the change necessary
Junio C Hamanof69a0a02008-07-17 08:08:4761to cherry-pick the named commit to your working tree
62and the index, but does not make the commit. In addition,
63when this option is used, your index does not have to match
Junio C Hamano1a4e8412005-12-27 08:17:2364the HEAD commit. The cherry-pick is done against the
Junio C Hamanof69a0a02008-07-17 08:08:4765beginning state of your index.
Junio C Hamano1a4e8412005-12-27 08:17:2366+
67This is useful when cherry-picking more than one commits'
Junio C Hamanof69a0a02008-07-17 08:08:4768effect to your index in a row.
Junio C Hamano1a4e8412005-12-27 08:17:2369
Junio C Hamanoeb415992008-06-08 22:49:4770-s::
71--signoff::
Junio C Hamano6d76d612008-05-09 05:46:0872Add Signed-off-by line at the end of the commit message.
73
Junio C Hamano1a4e8412005-12-27 08:17:2374
75Author
76------
Junio C Hamano0868a302008-07-22 09:20:4477Written by Junio C Hamano <gitster@pobox.com>
Junio C Hamano1a4e8412005-12-27 08:17:2378
79Documentation
80--------------
81Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
82
83GIT
84---
Junio C Hamanof7c042d2008-06-06 22:50:5385Part of the linkgit:git[1] suite